home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 453 < prev    next >
Text File  |  1996-08-06  |  2KB  |  33 lines

  1. Newsgroups: comp.std.c
  2. Path: phcoms4.seri.philips.nl!panther!baynes
  3. From: baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes)
  4. Subject: Re: sizeof(char) ~= sizeof(float)
  5. Sender: news@ukpsshp1.serigate.philips.nl (account for localnews)
  6. Message-ID: <DnFr78.1wo@ukpsshp1.serigate.philips.nl>
  7. Date: Tue, 27 Feb 1996 13:09:08 GMT
  8. References: <WALD.96Feb24131532@woodpecker.lcs.mit.edu> <4gr3d1$dca@usenet.pa.dec.com> <TANMOY.96Feb25203514@qcd.lanl.gov>
  9. Organization: Philips Semiconductors, Southampton, UK
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov) wrote:
  13. : In article <4gr3d1$dca@usenet.pa.dec.com>
  14. : diamond@tbj.dec.com (Norman Diamond) writes:
  15. <snip - copying data by using chars of different sorts vs memcpy >
  16. : This was a free-standing implementation, and memcpy may be absent. (In
  17. : a hosted implementation, as all read/write is done as if through
  18. : getc/putc which handles unsigned char values, and binary files written
  19. : out must be read back unchanged, the situation is impossible).
  20.  
  21. That read/write is done by getc/putc does not imply very much about copying
  22. chars. I don't see any requirement that fwrite/fread use one putc/getc per
  23. byte(ie char) of memory. Fwrite could use one per bit writing the values 'Y' or
  24. 'N' if it wanted so long as fread will read it back again. My understanding
  25. is that the use of getc/putc means you can write a file with fwrite, copy it
  26. with getc/putc and read the copy with fread to get what you started with.
  27.  
  28. --
  29. Stephen Baynes                              baynes@ukpsshp1.serigate.philips.nl
  30. Philips Semiconductors Ltd
  31. Southampton                                 My views are my own.
  32. United Kingdom
  33.